package top.iflyoung.cim.biz.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.iflyoung.cim.biz.entity.GroupChatMessage;
import top.iflyoung.cim.biz.mapper.GroupChatMessageMapper;
import top.iflyoung.cim.biz.service.GroupChatMessageService;
import top.iflyoung.cim.common.util.VerifyUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liguiyang
 * @description
 * @sine 1.8
 * @date 2021/9/222:44
 **/
@Service("groupChatMessageService")
public class GroupChatMessageServiceImpl extends ServiceImpl<GroupChatMessageMapper, GroupChatMessage> implements GroupChatMessageService {
    @Override
    public List<GroupChatMessage> findGroupChatMessageByGroupId(Long groupId) {
        List<GroupChatMessage> messages = new ArrayList<>();
        if (!VerifyUtil.isEmpty(groupId)) {
            messages.addAll(baseMapper.queryAllByGroupId(groupId));
        }
        return messages;
    }
}
